<!--#
layout("/layouts/store.html"){
#-->
<header class="header navbar bg-white shadow">
    <div class="btn-group tool-button">
        <a class="btn btn-primary navbar-btn" href="${base}/store/integral/rule" id="goBack" data-pjax><i class="ti-angle-left"></i>${msg['globals.button.back']}</a>
    </div>
</header>

<div class="content-wrap">
    <div class="wrapper" style="min-height:500px;">
        <section class="panel panel-form">
            <form id="addForm" role="form" class="form-horizontal parsley-form" data-parsley-validate
                  action="${base}/store/integral/rule/addDo" method="post">
                <div class="row mb10 mt10">
                    <div class="col-lg-12">
                        <div class="form-group">
                            <label for="ruleName" class="col-sm-2 control-label">规则名称</label>
                            <div class="col-sm-8">
                            <input type="text" id="ruleName" class="form-control" name="ruleName" data-parsley-required="true" placeholder="${msg['integral.rule.column.ruleName']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="ruleCode" class="col-sm-2 control-label">规则编码</label>
                            <div class="col-sm-8">
                            <input type="text" id="ruleCode" class="form-control" name="ruleCode" data-parsley-required="true" placeholder="${msg['integral.rule.column.ruleCode']}">
                            </div>
                        </div>
                        <!--<div class="form-group" >-->
                            <!--<label for="integralType" class="col-sm-2 control-label">积分周期</label>-->
                            <!--<div class="col-sm-8">-->
                                <!--<select name="integralType" id="integralType" class="form-control required">-->
                                    <!--<option value="1">一次性</option>-->
                                    <!--<option value="2">一天</option>-->
                                    <!--<option value="3">每次</option>-->
                                <!--</select>-->
                            <!--</div>-->
                        <!--</div>-->
                        <div class="form-group">
                            <label for="integralCount" class="col-sm-2 control-label">赠送积分数量</label>
                            <div class="col-sm-8">
                            <input type="text" id="integralCount" class="form-control" name="integralCount" data-parsley-required="true" placeholder="赠送积分数量">
                            </div>
                        </div>
                        <!--<div class="form-group">-->
                            <!--<label for="pointsType" class="col-sm-2 control-label"></label>-->
                            <!--<div class="col-sm-8">-->
                            <!--<input type="text" id="pointsType" class="form-control" name="pointsType" data-parsley-required="true" placeholder="赠送积分数量">-->
                            <!--</div>-->
                        <!--</div>-->
                        <!--<div class="form-group">-->
                            <!--<label for="pointsCount" class="col-sm-2 control-label">${msg['integral.rule.column.pointsCount']}</label>-->
                            <!--<div class="col-sm-8">-->
                            <!--<input type="text" id="pointsCount" class="form-control" name="pointsCount" data-parsley-required="true" placeholder="${msg['integral.rule.column.pointsCount']}">-->
                            <!--</div>-->
                        <!--</div>-->
                    </div>
                </div>
                <div class="col-lg-3"></div>
                <div class="col-lg-6">
                    <div class="form-group text-center">
                        <label></label>

                        <div>
                            <button class="btn btn-primary btn-block btn-lg btn-parsley" data-loading-text="${msg['globals.button.submit.tip']}">${msg['globals.button.submit']}</button>
                        </div>
                    </div>
                </div>
            </form>
        </section>
    </div>
</div>
<script language="JavaScript">
    $(document).ready(function () {
        $('#addForm').ajaxForm({
            dataType: 'json',
            beforeSubmit: function (arr, form, options) {
                form.find("button:submit").button("loading");
            },
            success: function (data, statusText, xhr, form) {
                if (data.code == 0) {
                    Toast.success(data.msg);
                    form.resetForm();
                } else {
                    Toast.error(data.msg);
                }
                form.find("button:submit").button("reset");
            }
        });
    });
</script>
<!--#}#-->


